package com.hxp.birthday;

import android.annotation.SuppressLint;
import android.os.Bundle;
import android.support.v4.app.Fragment;
import android.util.DisplayMetrics;
import android.view.LayoutInflater;
import android.view.View;
import android.view.ViewGroup;
import android.view.animation.Animation;
import android.view.animation.TranslateAnimation;
import android.widget.TextView;

@SuppressLint("NewApi")
public class FourthFragment extends Fragment {
	private TextView fourthText;

	@Override
	public View onCreateView(LayoutInflater inflater, ViewGroup container,
			Bundle savedInstanceState) {
		View fourth = inflater.inflate(R.layout.fourth, null);
		fourthText = (TextView) fourth.findViewById(R.id.text_fourth);
		DisplayMetrics dm2 = getResources().getDisplayMetrics();

		int width = (dm2.widthPixels) / 2;
		int height = (dm2.heightPixels) / 2;
		Animation translateAnimation = new TranslateAnimation(width, 0f,0f,0f);
		translateAnimation.setDuration(2000);
		
		fourthText.startAnimation(translateAnimation);

		return fourth;
	}

}
